package com.easyctrl.db;

import java.util.ArrayList;

import android.app.Activity;
import android.widget.ListAdapter;

import com.easyctrl.adapter.FloorAdapter;
import com.easyctrl.adapter.RoomAdapter;
import com.easyctrl.fragment.FloorRoomFragment;
import com.easyctrl.impl.FloorRoomModuleListener;
import com.easyctrl.ldy.domain.FloorBean;
import com.easyctrl.ldy.domain.RoomBean;

public class FragmentPortUtile {

	public static FloorRoomFragment toFloorRoomFragmentbyFloor(final Activity activity,final ArrayList<FloorBean> beans){
		FloorRoomFragment frf = new FloorRoomFragment(); 
		frf.setOnFloorroomModuleListener(new FloorRoomModuleListener() {
			
			@Override
			public ListAdapter onFloorRoomModuleListener() { 
				FloorAdapter adapter = FloorAdapter.getInstance(activity);
				adapter.setBeans(beans);
				return adapter;
			}

			@Override
			public void addListener() { 
				
			}

			@Override
			public void deleteListener() { 
				
			}

			@Override
			public void onSaveORUpdate(int position) { 
				
			}

			@Override
			public void onCancel() { 
				
			}

			@Override
			public void onPause() {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void onDestroy() {
				// TODO Auto-generated method stub
				
			}
		});
		return frf;
	}
	
	public static FloorRoomFragment toFloorRoomFragmentbyRoom(final Activity activity,final ArrayList<RoomBean> beans){
		FloorRoomFragment frf = new FloorRoomFragment(); 
		frf.setOnFloorroomModuleListener(new FloorRoomModuleListener() {
			
			@Override
			public ListAdapter onFloorRoomModuleListener() { 
				RoomAdapter adapter = RoomAdapter.getInstance(activity);
				adapter.setBeans(beans);
				return adapter;
			}

			@Override
			public void addListener() { 
				
			}

			@Override
			public void deleteListener() { 
				
			}

			@Override
			public void onSaveORUpdate(int position) { 
				
			}

			@Override
			public void onCancel() { 
				
			}

			@Override
			public void onPause() {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void onDestroy() {
				// TODO Auto-generated method stub
				
			}
		});
		return frf;
	}
}
